feat: miners leaderboard username sort#1217
Conversation
|
Please provide screenshots or other visual media follow contributing.md |
|
I just uploaded screenshots, please review again. |
…ub.com/andriypolanski/gittensor-ui into feat/miners-leaderboarad-username-sort
anderdc
left a comment
There was a problem hiding this comment.
Please scope this down to what #1216 asks for. Keep: the username sort wiring in types.ts, TopMinersTable.tsx, and MinersList.tsx. Drop: the index.ts barrel change — FONTS, getRankColors, minerSortName, and SortOption have no consumers through the barrel, and TopMinersTable imports minerSortName directly from ./types, so the export serves nothing.
anderdc
left a comment
There was a problem hiding this comment.
Drop the src/components/leaderboard/index.ts change. Nothing imports minerSortName, FONTS, getRankColors, or SortOption through the barrel — TopMinersTable.tsx imports minerSortName from ./types directly, and the existing FONTS/getRankColors consumers (BountySidebar.tsx, search/RepositoryTab.tsx) use the ./leaderboard/types deep path. The barrel additions have zero consumers.
Keep the types.ts, TopMinersTable.tsx, and MinersList.tsx changes — that's the feature, and it's fine.
Summary
The miners leaderboard could be sorted by score, earnings, activity counts, and credibility, but not by miner name. Users looking up a GitHub login had to rely on search alone. The repositories leaderboard already supports Repository sort (A→Z, URL state, list header click); miners had no equivalent for identity.
Related Issues
Closes #1216
Type of Change
Screenshots
Before
before.mp4
After
after.mp4
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpassesSolution
Introduce a
usernameSortOptionthat sorts miners alphabetically by GitHub login, following the same pattern asrepositoryonTopRepositoriesTable.Files
src/components/leaderboard/types.tsusernamesort key;minerSortNamehelpersrc/components/leaderboard/TopMinersTable.tsxsrc/components/leaderboard/MinersList.tsxsortKey: 'username'src/components/leaderboard/index.tsminerSortName